<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Registration Page</title>
    </h:head>
    <h:body>
        <h:form id="registrationForm">
            <h:panelGrid id="displayRegistrationForm" >
                <h:outputLabel for="name" value="Name:"/>
                <p:inputText value="#{registrationBean.registeredUser.name}" id="name" required="true" label="name"/>
                <p:message for="name"/>
                <h:outputLabel for="surname" value="Surname(*):"/>
                <p:inputText value="#{registrationBean.registeredUser.surname}" id="surname" required="true" label="surname"/>
                <p:message for="surname"/>
                <h:outputLabel for="username" value="Username(*):"/>
                <p:inputText id="username" value="#{registrationBean.registeredUser.username}" required="true" label="username"/>
                <p:message for="username"/>
                <h:outputLabel for="password" value="Password(*):"/>
                <h:inputSecret id="password" value="#{registrationBean.registeredUser.password}" required="true" label="password"/>
                <p:message for="password"/>
                <h:outputLabel for="email" value="Email(*):"/>
                <p:inputText id="email" value="#{registrationBean.registeredUser.email}" required="true" label="email"/>
                <p:message for="email"/>
                <p:selectOneRadio id="sor" value="#{registrationBean.registeredUser.userType}" required="true">
                    <f:selectItem id="ut1"   itemLabel="Student" itemValue="student" />
                    <f:selectItem id="ut2"  itemLabel="lecturer" itemValue="lecturer" />
                    <f:selectItem id="ut3"   itemLabel="Other academic staff" itemValue="other academic staff" />
                </p:selectOneRadio>                
                <h:outputLabel for="streetName" value="Street Name(*):"/>
                <p:inputText id="streetName" value="#{registrationBean.registeredUser.streetName}" required="true" label="streetName"/>
                <p:message for="streetName"/>
                <h:outputLabel for="zip" value="Zip(*):"/>
                <p:inputText id="zip" value="#{registrationBean.registeredUser.zip}" required="true" label="zip"/>
                <p:message for="zip"/>
                <h:outputLabel for="website" value="Website:"/>
                <p:inputText id="website" value="#{registrationBean.registeredUser.website}" label="website"/>
                <p:message for="website"/>
                <f:facet name="footer"> 
                    <p:commandButton value="Register" action="#{registrationBean.persistRegisteredUser}" update="displayRegistrationForm"/>
                    <p:commandButton value="Cancel" action="dreg.hide()"></p:commandButton> 
                </f:facet>
            </h:panelGrid>
        </h:form>
    </h:body>
</html>

